/* GMRobot.cc -- Representação de um robo
 *
 * Copyright (C) 2008, Diogo F. S. Ramos <diogo.ramos@usp.br>
 * GEAR - Grupo de Estudos Avançados em Robótica
 * <http://www.sel.eesc.usp.br/gear>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#include <string>
#include <vector>

#include "RPCTranslator.hh"
#include "GMRobot.hh"


GMRobot::GMRobot( const int id,
		  const std::string end,
		  const std::string addr,
		  const int port )
{
    id_ = id;
    end_ = end;
    gm_client_.Init( addr, port );
    gm_client_.RegisterRobotName( id, end );
    //field = std::vector<float>( LENGTH_FIELD_VECTOR, 0.0);
    //world = std::vector<float>( LENGTH_WORLD_VECTOR, 0.0);
}

GMRobot::~GMRobot()
{
}

int
GMRobot::Read()
{
    gm_client_.getField( field );
    return 0;
}

int
GMRobot::ReadWorld()
{
    gm_client_.getWorld( world );
    return 0;
}

int
GMRobot::SetVel( const float vx, const float vy, const float va)
{
    gm_client_.SetVel( id_, vx, vy, va );
    return 0;
}

int
GMRobot::DribbleEnable( const bool enable )
{
    gm_client_.DribbleEnable( id_, enable );
    return 0;
}

int
GMRobot::Kick( const int nivel )
{
    gm_client_.Kick( id_, nivel );
    return 0;
}

int
GMRobot::SayHello()
{
    gm_client_.SayHello( id_ );

    return 0;
}
